<template>
	<view class="w100 bg-white pb-40" style="border-radius: 10rpx 10rpx 0 0;">
		<view class="flex plr-36 pt-30 ">
			<view class="size-36 bold">
				订单取消成功
			</view>
			<view v-if="huoyun&&info.pay_method==1" class="blue" @click="toRefund">查看退款详情<u-icon
					name="arrow-right ml-10"></u-icon>
			</view>
		</view>
		<view class="plr-36 pb-20 mt-10 bb">
			订单已取消，您可以重新呼叫
		</view>
		<view class="plr-36 pt-30 flex1 flex-middle">
			<u-icon name="clock" size="40" color="#999"></u-icon>
			<text class="ml-20">{{info.createtime|formatDate(1)}}</text>
		</view>
		<!-- 		<view class="plr-36 pt-30 flex1 flex-middle">
			<view class="bg-green" style="width: 16rpx;height: 16rpx;border-radius: 50%;"></view>
			<text class="ml-20">{{info.start}}</text>
		</view>
		<view v-if="!huoyun" class=" plr-36 pt-30 flex1 flex-middle">
			<view class="bg-orange" style="width: 16rpx;height: 16rpx;border-radius: 50%;"></view>
			<text class="ml-20">{{info.end}}</text>
		</view> -->
		<!-- 	<view v-for="(item,i) in info.shaddress" :key="i" class="plr-36 pt-30 flex1 flex-middle">
			<view class="bg-orange" style="width: 16rpx;height: 16rpx;border-radius: 50%;"></view>
			<text class="ml-20">{{item.end}}</text>
		</view> -->
		<!-- <view class="mlr-36 mt-50 change-green white text-center size-32" style="height: 96rpx;line-height: 96rpx;">
			重新叫车
		</view> -->
		<view class="mlr-36 mt-100 ">
			<u-button type="primary" shape="circle" :custom-style="customStyle" @click="submit">
				重新叫车
			</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['info', "huoyun", 'refund_id'], //-1取消
		data() {
			return {
				value: '',
				id: '', //订单id
				info: {}, //-2超时，-1=已取消,0=呼叫中,1=已接单,2=进行中,3=待支付,4=司机已到达,5=预约单司机待出发,99=已完成'
			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			//订单信息
			init() {
				uni.showLoading({ // title: '加载中'
				});
				let _this = this
				this.$http('/addons/ddrive/order/info', {
					order_id: this.id
				}, "POST").then(data => {
					uni.hideLoading();
					this.info = data,
						this.phone = data.driver.mobile
					// 动态title
					uni.setNavigationBarTitle({
						title: data.status_text
					})
					if (this.arr1.includes(this.info.status * 1)) {
						this.timer1 = setInterval(() => {
							this.update()
						}, 5000)
					}
					uni.getLocation({
						type: 'gcj02',
						success: function(res) {
							console.log('当前位置的经度1：' + res.longitude);
							console.log('当前位置的纬度1：' + res.latitude);
							_this.longitude = res.longitude
							_this.latitude = res.latitude
							_this.polyline = []
							// _this.getLine()
						}
					});
				})
			},
			toRefund() {
				console.log(this.info);
				uni.navigateTo({
					url: '/pages/huoyun/refund-detail?id=' + this.refund_id
				})
			},
			submit() {
				uni.reLaunch({
					url: '/pages/home/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	/deep/.u-btn--primary {
		background-color: #00b6b4 !important;
		border-radius: 50rpx !important;
	}

	/deep/.u-primary-hover {
		background-color: linear-gradient(to right, #00b6b4, #00d496) !important;
	}

	/deep/.u-radio {
		display: flex;
		flex-direction: row-reverse;
	}

	/deep/.u-radio__label {
		margin-left: 0;
		margin-right: 0;
	}

	.img {
		image {
			width: 40rpx;
			height: 40rpx;
		}
	}
</style>
